package com.example.service.impl;

import com.example.pojo.Order;
import com.example.service.OrderService;
import com.example.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Arrays;

/**
 * @author yinyin
 * @create 2021/07/14 下午 3:28
 */
@Service
public class OrderServiceImpl implements OrderService {


    @Autowired
    private ProductService productService;
    @Override
    public Order selectOne(Integer id) {


        return new Order(id,"order-003","中国",29000D,
                Arrays.asList(productService.selectProductById(5)));
    }


    @Override
    public Order queryOne(Integer id) {
        return new Order(id,"order-002","中国",11660D,productService.selectProductList());
    }

    @Override
    public Order searchOne(Integer id) {
        return new Order(id,"order--003","中国",2266D, productService.selectProductListByIds(Arrays.asList(1,2)));
    }
}
